import { Button } from '@antmjs/vantui';
import { View } from '@tarojs/components';
import { useRouter, navigateBack } from '@tarojs/taro';
import { eventsBus } from '@vh-mobile/pro-utils';
import { useEffect, useRef } from 'react';
import './index.less';
//选择业绩交叉人员
const AllEditPagePersonnelList = () => {
  const router = useRouter();
  const propsRef = useRef<any>();

  useEffect(() => {
    const { dataIndex } = router.params;
    eventsBus.$trigger(`FOpenPageCustom-${dataIndex}`, {
      callback: (props: any) => {
        propsRef.current = props;
      },
    });
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, []);

  const onClick = () => {
    // propsRef.current.onChange('cscs');
    propsRef.current.onChange([
      1,
      'cs这是一个超长的地址需要分析或者显示2段来展示啊的地址需要分析或者显示2段来实打实大苏打111111csdd',
    ]);
    navigateBack();
  };

  return (
    <>
      <View>
        <Button type="primary" block onClick={onClick}>
          点击传递数据
        </Button>
      </View>
    </>
  );
};

export default AllEditPagePersonnelList;
